/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * RSTranslate.h
 *
 *  Created on: 2010/03/04
 *      Author: Alexandre Pires ( c.alexandre.pires@gmail.com )
 */

#ifndef RSTRANSLATE_H_
#define RSTRANSLATE_H_

#include "RSTransformationElement.h"

namespace Realsphere {

    class RSTranslate: public Realsphere::RSTransformationElement {
        Q_OBJECT
        public:
            Q_INVOKABLE RSTranslate ( const QString& rScopeId = QString::null );
            virtual ~RSTranslate();

        public:
            QVector3D               Position () const;

        public slots:
            void                    SetPosition ( const QVector3D& rPosition, bool rEmit = true );
            void                    SetPosition ( qreal rX, qreal rY, qreal rZ, bool rEmit = true );

            void                    ApplyTranslation( const QVector3D& rDisplacement );
            void                    ApplyTranslation (  qreal rX, qreal rY, qreal rZ );

        signals:
            void                    PositionChanged ( const QVector3D& rPosition );

        protected:
            void                    WriteElementData ( QXmlStreamWriter* rXmlWriter );
            void                    UpdateTransformation ();

        private:
            QVector3D               mPosition;
    };

}

#endif /* RSTRANSLATE_H_ */
